package com.admin.controller;


import com.admin.pojo.UserInfo;
import com.admin.service.UserInfoService;
import com.admin.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2025-06-03 04:58:32
 */
@RestController
public class UserInfoController {

    @Autowired
    UserInfoService userInfoService;


    @RequestMapping("/register")
    public R register(UserInfo userInfo) {
       return userInfoService.register(userInfo);
    }

    @RequestMapping("/sendCode")
    public R sendCode(String email, HttpServletRequest request) {
        return userInfoService.sendCode(email,request);
    }

    @RequestMapping("/loginCode")
    public R loginCode(String email, String code, HttpServletRequest request) {
        return userInfoService.loginCode(email,code,request);
    }

}

